@extends('admin.layout')
@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
            <!-- Small boxes (Stat box) -->
            {{--<div class="row">--}}
                {{--<div class="col-lg-3 col-xs-6">--}}
                    {{--<!-- small box -->--}}
                    {{--<div class="small-box bg-aqua">--}}
                        {{--<div class="inner">--}}
                            {{--<h2 style="margin-top: 20px;">会员管理</h2>--}}

                            {{--<p></p>--}}
                        {{--</div>--}}
                        {{--<div class="icon">--}}
                            {{--<i class="ion ion-person-add"></i>--}}
                        {{--</div>--}}
                        {{--<a href="{{ url('admin/users') }}" class="small-box-footer">Go!<i class="fa fa-arrow-circle-right"></i></a>--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<!-- ./col -->--}}
                {{--<div class="col-lg-3 col-xs-6">--}}
                    {{--<!-- small box -->--}}
                    {{--<div class="small-box bg-green">--}}
                        {{--<div class="inner">--}}
                            {{--<h2 style="margin-top: 20px;">订单列表<sup style="font-size: 20px"></sup></h2>--}}

                            {{--<p></p>--}}
                        {{--</div>--}}
                        {{--<div class="icon">--}}
                            {{--<i class="ion ion-stats-bars"></i>--}}
                        {{--</div>--}}
                        {{--<a href="{{ url('admin/orders') }}" class="small-box-footer">Go!<i class="fa fa-arrow-circle-right"></i></a>--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<!-- ./col -->--}}
                {{--<div class="col-lg-3 col-xs-6">--}}
                    {{--<!-- small box -->--}}
                    {{--<div class="small-box bg-yellow">--}}
                        {{--<div class="inner">--}}
                            {{--<h2 style="margin-top: 20px;">批量订单导入</h2>--}}

                            {{--<p></p>--}}
                        {{--</div>--}}
                        {{--<div class="icon">--}}
                            {{--<i class="ion ion-bag"></i>--}}
                        {{--</div>--}}
                        {{--<a href="{{ url('admin/batch') }}" class="small-box-footer">Go!<i class="fa fa-arrow-circle-right"></i></a>--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<!-- ./col -->--}}
                {{--<li class="treeview">--}}
                    {{--<a href="#">--}}
                        {{--<i class="fa fa-edit"></i> <span>批量订单管理</span>--}}
                        {{--<span class="pull-right-container">--}}
              {{--<i class="fa fa-angle-left pull-right"></i>--}}
            {{--</span>--}}
                    {{--</a>--}}
                    {{--<ul class="treeview-menu">--}}
                        {{--<li><a href="{{ url('admin/batch') }}"><i class="fa fa-circle-o"></i> 批量订单导入</a></li>--}}
                        {{--<li><a href="{{ url('admin/audit') }}"><i class="fa fa-circle-o"></i> 批量订单审核</a></li>--}}
                    {{--</ul>--}}
                {{--</li>--}}
                {{--<!-- ./col -->--}}
                {{--<div class="col-lg-3 col-xs-6">--}}
                    {{--<!-- small box -->--}}
                    {{--<div class="small-box bg-red">--}}
                        {{--<div class="inner">--}}
                            {{--<h2 style="margin-top: 20px;">批量订单审核</h2>--}}

                            {{--<p></p>--}}
                        {{--</div>--}}
                        {{--<div class="icon">--}}
                            {{--<i class="ion ion-pie-graph"></i>--}}
                        {{--</div>--}}
                        {{--<a href="{{ url('admin/audit') }}" class="small-box-footer">Go!<i class="fa fa-arrow-circle-right"></i></a>--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<!-- ./col -->--}}
            {{--</div>--}}

            <div class="row">
                <div class="col-lg-12">
                    <div class="box box-solid">
                        <div class="box-header with-border">
                            <a data-toggle="collapse" data-parent="#accordionOne" href="#collapseOne" style="color: #000;">
                               <strong>用户信息</strong>
                            </a>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <div class="box-group" id="accordionOne">
                                <!-- we are adding the .panel class so bootstrap.js collapse plugin detects it -->
                                <div class="panel box box-primary">
                                    <div id="collapseOne" class="panel-collapse collapse in">
                                        <div class="box-body">
                                            <table>
                                                <tr>
                                                    <td style="min-width: 220px;"><span style="font-size: 20px;">用户名：<strong style="font-size: 20px;color: #f00;">{{ $list['username'] }}</strong></span></td>
                                                    <td style="min-width: 220px;"><span  style="font-size: 20px;">角色：{{ App\Role::find($list['roleid'])['name'] }}</span></td>
                                                </tr>
                                                <tr>
                                                    <td style="min-width: 220px;"><span>上次登录时间：{{ $list['login_time'] }}</span></td>
                                                    <td style="min-width: 220px;"><span>上次登录IP：{{ $list['ip'] }}</span></td>
                                                </tr>
                                                <tr>
                                                    <td style="min-width: 220px;"><span>联系电话：{{ $list['phone'] }}</span></td>
                                                    <td style="min-width: 220px;"><span>邮箱：{{ $list['email'] }}</span></td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            @if(Session::get('roleid') == 1)
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box box-solid">
                            <div class="box-header with-border">
                                <a data-toggle="collapse" data-parent="#accordionSeven" href="#collapseSeven" style="color: #000;">
                                    <strong>用户数量</strong>
                                </a>

                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="box-group" id="accordionSeven">
                                    <!-- we are adding the .panel class so bootstrap.js collapse plugin detects it -->
                                    <div class="panel box box-primary">
                                        <div id="collapseSeven" class="panel-collapse collapse in">
                                            <div class="box-body">
                                                <p>业务经理有<span style="color: #f00;">{{ $num['m_num'] }}</span>人</p>
                                                <p>兑换专员有<span style="color: #f00;">{{ $num['c_num'] }}</span>人</p>
                                                <p>客户经理有<span style="color: #f00;">{{ $num['k_num'] }}</span>人</p>
                                                <p>注册会员有<span style="color: #f00;">{{ $num['u_num'] }}</span>人</p>
                                                <p>合作商有<span style="color: #f00;">{{ $num['p_num'] }}</span>家</p>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
            @endif
            @if(Session::get('roleid') == 2)
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box box-solid">
                            <div class="box-header with-border">
                                <a data-toggle="collapse" data-parent="#accordionFire" href="#collapseFire" style="color: #000;">
                                    <strong>名下兑换专员</strong>
                                </a>

                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="box-group" id="accordionFire">
                                    <!-- we are adding the .panel class so bootstrap.js collapse plugin detects it -->
                                    <div class="panel box box-primary">
                                        <div id="collapseFire" class="panel-collapse collapse in">
                                            <div class="box-body">
                                                @if(!empty($man))
                                                    <table class="table table-striped table-hover text-center">
                                                        <tr>
                                                            <th style="min-width: 75px;">编号</th>
                                                            <th style="min-width: 75px;">创建时间</th>
                                                            <th style="min-width: 75px;">用户名</th>
                                                            <th style="min-width: 75px;">手机号</th>
                                                            <th style="min-width: 75px;">邮箱</th>
                                                            <th style="min-width: 75px;">所属工号</th>
                                                        </tr>
                                                        @foreach($man as $v)
                                                            <tr>
                                                                <td>{{ $v['id'] }}</td>
                                                                <td>{{ $v['create_time'] }}</td>
                                                                <td>{{ $v['username'] }}</td>
                                                                <td>{{ $v['phone'] }}</td>
                                                                <td>{{ $v['email'] }}</td>
                                                                {{--<td>{{ $value['par_id'] }}</td>--}}
                                                                <td>{{ App\Manage::find($v['son_id'])['username'] }}</td>
                                                            </tr>
                                                        @endforeach
                                                    </table>
                                                @else
                                                    名下没有兑换专员
                                                @endif
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box box-solid">
                            <div class="box-header with-border">
                                <a data-toggle="collapse" data-parent="#accordionFour" href="#collapseFour" style="color: #000;">
                                    <strong>名下客户经理</strong>
                                </a>

                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="box-group" id="accordionFour">
                                    <!-- we are adding the .panel class so bootstrap.js collapse plugin detects it -->
                                    <div class="panel box box-primary">
                                        <div id="collapseFour" class="panel-collapse collapse in">
                                            <div class="box-body">
                                                @if(empty($manager))名下没有客户经理
                                                @else
                                                    <table class="table table-striped table-hover text-center">
                                                        <tr>
                                                            <th style="min-width: 75px;">编号</th>
                                                            <th style="min-width: 75px;">创建时间</th>
                                                            <th style="min-width: 75px;">用户名</th>
                                                            <th style="min-width: 75px;">手机号</th>
                                                            <th style="min-width: 75px;">邮箱</th>
                                                            <th style="min-width: 75px;">所属工号</th>
                                                        </tr>
                                                        @foreach($manager as $e)
                                                            <tr>
                                                                <td>{{ $e['id'] }}</td>
                                                                <td>{{ $e['create_time'] }}</td>
                                                                <td>{{ $e['username'] }}</td>
                                                                <td>{{ $e['phone'] }}</td>
                                                                <td>{{ $e['email'] }}</td>
                                                                {{--<td>{{ $value['par_id'] }}</td>--}}
                                                                <td>{{ App\Manage::find($e['son_id'])['username'] }}</td>
                                                            </tr>
                                                        @endforeach
                                                    </table>
                                                @endif
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
            @elseif(Session::get('roleid') == 3)
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box box-solid">
                            <div class="box-header with-border">
                                <a data-toggle="collapse" data-parent="#accordionThree" href="#collapseThree" style="color: #000;">
                                    <strong>新的批量信息</strong>
                                </a>
                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="box-group" id="accordionThree">
                                    <!-- we are adding the .panel class so bootstrap.js collapse plugin detects it -->
                                    <div class="panel box box-primary">
                                        <div id="collapseThree" class="panel-collapse collapse in">
                                            <div class="box-body">
                                                <table class="table table-striped table-hover text-center">
                                                    <tr>
                                                        <th>编号</th>
                                                        <th>创建时间</th>
                                                        <th>批次号</th>
                                                        <th>客户经理</th>
                                                        {{--<th>商品名称</th>--}}
                                                        {{--<th>商品数量</th>--}}
                                                        {{--<th>订单总价</th>--}}
                                                        {{--<th>客户ID</th>--}}
                                                        {{--<th>客户经理ID</th>--}}
                                                        {{--<th>订单状态</th>--}}
                                                        <th style="width: 130px; text-align:center">操作</th>
                                                    </tr>
                                                    <tr>
                                                        <td>{{ $order['id'] }}</td>
                                                        <td>{{ $order['create_time'] }}</td>
                                                        <td>{{ $order['batch'] }}</td>
                                                        <td>{{ App\Manage::find($order['manage_id'])['username'] }}</td>
                                                        <td>
                                                            <a class="btn btn-default btn-xs"  href="{{ url('admin/orders/toAudit/'.$order['batch'] )}}" >查看详细<a>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                </div>
            @elseif(Session::get('roleid') == 4)
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box box-solid">
                            <div class="box-header with-border">
                                <a data-toggle="collapse" data-parent="#accordionTwo" href="#collapseTwo" style="color: #000;">
                                    <strong>会员信息</strong>
                                </a>

                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="box-group" id="accordionTwo">
                                    <!-- we are adding the .panel class so bootstrap.js collapse plugin detects it -->
                                    <div class="panel box box-primary">
                                        <div id="collapseTwo" class="panel-collapse collapse in">
                                            <div class="box-body">
                                                <table class="table table-striped table-hover text-center">
                                                    <tr>
                                                        <th>编号</th>
                                                        <th>创建时间</th>
                                                        <th>姓名</th>
                                                        <th>性别</th>
                                                        <th>生日</th>
                                                        <th>电话</th>
                                                        <th>邮箱</th>
                                                        <th>积分</th>
                                                        <th>车牌号</th>
                                                    </tr>
                                                    @foreach($users as $u)
                                                        <tr>
                                                            <td>{{ $u['id'] }}</td>
                                                            <td>{{ $u['create_time'] }}</td>
                                                            <td>{{ $u['name'] }}</td>
                                                            <td>
                                                                @if($u['sex'] === '0')男
                                                                @elseif($u['sex'] === '1')女
                                                                @else
                                                                @endif
                                                            </td>
                                                            <td>{{ $u['birth'] }}</td>
                                                            <td>{{ $u['phone'] }}</td>
                                                            <td>{{ $u['email'] }}</td>
                                                            <td>{{ $u['integral'] }}</td>
                                                            <td>{{ $u['car_num']}}</td>
                                                        </tr>
                                                    @endforeach
                                                </table>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                </div>
            @endif
            <!-- /.row (main row) -->
            {{--<div class="row">--}}
                {{--<div class="col-lg-12">--}}
                    {{--<div class="box box-solid">--}}
                        {{--<div class="box-header with-border">--}}

                        {{--</div>--}}
                        {{--<!-- /.box-header -->--}}
                        {{--<div class="box-body">--}}
                            {{--<div class="box-group" id="accordion">--}}
                                {{--<!-- we are adding the .panel class so bootstrap.js collapse plugin detects it -->--}}
                                {{--<div class="panel box box-primary">--}}
                                    {{--<div class="box-header with-border">--}}
                                        {{--<h4 class="box-title">--}}
                                            {{--<a data-toggle="collapse" data-parent="#accordion" href="#collapseSix">--}}
                                                {{--欢迎来到保祥·云商城管理系统--}}
                                            {{--</a>--}}
                                        {{--</h4>--}}
                                    {{--</div>--}}
                                    {{--<div id="collapseSix" class="panel-collapse collapse in">--}}
                                        {{--<div class="box-body">--}}
                                            {{--<p>变革创新 成就中国未来</p>--}}
                                        {{--</div>--}}
                                    {{--</div>--}}
                                {{--</div>--}}

                            {{--</div>--}}
                        {{--</div>--}}
                    {{--</div>--}}
                    {{--<!-- /.box-body -->--}}
                {{--</div>--}}
                {{--<!-- /.box -->--}}
            {{--</div>--}}
    <!-- /.row -->
    </section>
    <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
    <!-- ./wrapper -->
    <script>
//        $(function(){
////            window.location.href ="home1";
////            if(location.search.indexOf("?")==-1){
////                location.href = "/admin/home1";
////            }
////            else{
////                if(location.search.indexOf("myurl")==-1) location.href = "/admin/home1";
////            }
//        });

    </script>
@stop